//
//  YuXiDialectsViewController.m
//  DialectShare
//
//  Created by timmy zhong on 3/24/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "YuXiDialectsViewController.h"
#import "Const.h"
#import "DialectDB.h"
#import "DialectProxy.h"
#import "ListenViewController.h"

@interface YuXiDialectsViewController ()
@end

@implementation YuXiDialectsViewController
@synthesize yuxi = _yuxi;

- (void)viewDidLoad
{
    [super viewDidLoad];
    
	[self.proxy dialectsOfYuXi:self.yuxi];
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (NSArray *)getDialects
{
    return [self.db dialectsOfYuXi:self.yuxi start:0 count:1000];
}



#pragma mark - table delggate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    Dialect *dialect = [self.dialects objectAtIndex:indexPath.row];
    ListenViewController *controller = [[ListenViewController alloc] init];
    controller.dialect = dialect;
    [self.navigationController pushViewController:controller animated:YES];
    [controller release];
}

@end
